from httplib import *

def ttserver_stat(host, port, opt='x-tt-rnum'):
    http = HTTPConnection(host, port)
    http.request('OPTIONS', '/')
    response = http.getresponse()
    http.close()
    
    return response.getheader(opt)

if __name__ == '__main__':
    rnum  = int(ttserver_stat('10.32.12.137', 11211))
    rnum += int(ttserver_stat('10.32.12.137', 11212))
    rnum += int(ttserver_stat('10.32.12.137', 11213))
    rnum += int(ttserver_stat('10.32.12.137', 11214))
    
    print rnum

